{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}

{% block title %}Flasky{% endblock %}

{% block page_content %}
    <div class="page-header">
        <h1>Hello, {% if current_user.username %}{{ current_user.username }}{% else %}Stranger{% endif %}！</h1>
        {% if not current_user.username %}
            <p>Pleased to meet you!</p>
        {% else %}
            <p>Happy to see you again!</p>
        {% endif %}
    </div>
    <p>The local date and time is {{ moment(current_time).format('LLL') }}.</p>
    <p>That was {{ moment(current_time ).fromNow(refresh=True) }}</p>
    {{ current_time }}
    <div class="post-form">
        {% if current_user.can(Permission.WRITE_ARTICLES) %}
            {{ wtf.quick_form(form) }}
        {% endif %}
    </div>
    {% include '_posts.html' %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, '.index') }}
    </div>
{% endblock %}